package com.news.views;

import com.news.R;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.RelativeLayout;

public class NewsHeaderView extends RelativeLayout {

	private ImageButton leftButton;
	private ImageButton rightButton;
	
	public NewsHeaderView(Context context) {
		super(context);
		
	}
	
	/**
	 * Creates a SimpleTextField Widget with a defined Style.
	 * @param context
	 * @param attrs
	 */
	public NewsHeaderView(Context context, AttributeSet attrs) {
		super(context, attrs);
		init(context);
	}

	/**
	 * Creates a SimpleTextField Widget with a defined Style and a defined style.
	 * @param context
	 * @param attrs
	 * @param defStyle
	 */
	public NewsHeaderView(Context context, AttributeSet attrs, int defStyle) {
		super(context, attrs, defStyle);
		init(context);
	}


	/**
	 * This method initialize and inflate the resource xml that defines this widget.
	 * @param context
	 */
	private void init(Context context) {
		LayoutInflater inflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		ViewGroup inflated = (ViewGroup) inflater.inflate(R.layout.header_news, null);
		this.addView(inflated);
		
		leftButton = (ImageButton) findViewById(R.id.left_button);
		rightButton = (ImageButton) findViewById(R.id.right_button);
		
		

	}

	public void setDisableButtons(){
		this.rightButton.setVisibility(View.INVISIBLE);
		this.leftButton.setVisibility(View.INVISIBLE);
	}
	
	public ImageButton getLeftButton() {
		return leftButton;
	}

	public void setLeftButton(ImageButton leftButton) {
		this.leftButton = leftButton;
	}

	public ImageButton getRightButton() {
		return rightButton;
	}

	public void setRightButton(ImageButton rightButton) {
		this.rightButton = rightButton;
	}
	
}
